<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class UserDcoinsLogsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        //
        Schema::create('user_dcoins_logs', function(Blueprint $table) {
            $table->increments('id');
            $table->integer('user_id')->index()->comment('用户ID');
            $table->tinyInteger('type')->comment('类型,1奖励，2扣除');
            $table->float('dcoins', 11, 2)->comment('变更D币');
            $table->float('remain_dcoins', 11, 2)->comment('剩余D币');
            $table->tinyInteger('reason_type')->comment('D币变更原因，后期定义，如 1=>赞助');
            $table->integer('yz_payment_id')->index()->comment('订单id，赞助会有');
            $table->string('remark')->comment('备注');
            $table->softDeletes();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
        Schema::drop('user_dcoins_logs');
    }
}
